package com.ysfxt.controller;

import com.ysfxt.result.Result;
import com.ysfxt.result.ResultCodeEnum;
import com.ysfxt.service.FileUploadService;
import com.ysfxt.vo.FileVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author 盐酸氟西汀
 * @create 2024/3/30 23:15
 * @email 480738950@qq.com
 */
@RestController
@RequestMapping("/api/judge-system")
public class FileUploadController {
    @Autowired
    private FileUploadService fileUploadService;
    
    @PostMapping("/fileUpload")
    public Result fileUpload(MultipartFile file){
        //获取上传文件
        //调用service
        FileVo f=fileUploadService.uploadFile(file);
        return Result.build(f, ResultCodeEnum.SUCCESS);
    }
}